<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>

<form:form commandName="teamInfoFilter" cssClass="form-horizontal"
	role="form" onsubmit="return false;">

	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right"
					 for=teamName>小分队名</label>
		<div class="col-sm-5">
			<input type="text" name="teamName" id="teamName"
				   placeholder="请输入小分队名称" value="${teamInfoFilter.teamName}"
				   class="form-control required">
		</div>

		<label class="col-sm-1 control-label no-padding-right" for="teamClass">组别</label>

		<div class="col-sm-5">
			<select name="teamId" class="form-control required" style="width: 100%"
					data-placeholder="组别" id="teamClassId" onchange="findtwoClass()">
				<option value="${teamInfoFilter.teamId }">${teamInfoFilter.teamClass }</option>
				<c:forEach items="${teamClass}" var="teamClass">
					<option value="${teamClass.teamId }">${teamClass.teamClass }</option>
				</c:forEach>
			</select>
		</div>

	</div>

	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right"
			   for="leader">责任领导</label>
		<div class="col-sm-5">
			<input type="text" name="leader" id="leader"
				   placeholder="请输入责任领导" value="${teamInfoFilter.leader}"
				   class="form-control required">
		</div>

		<label class="col-sm-1 control-label no-padding-right"
			   for="fenguanleager">分管领导</label>
		<div class="col-sm-5">
			<input type="text" name="fenguanleager" id="fenguanleager"
				   placeholder="请输入分管领导" value="${teamInfoFilter.fenguanleager}"
				   class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right"
			   for="captain">小队长</label>
		<div class="col-sm-5">
			<input type="text" name="captain" id="captain"
				   placeholder="请输入队长" value="${teamInfoFilter.captain}"
				   class="form-control ">
		</div>

		<label class="col-sm-1 control-label no-padding-right"
			   for="member">成员单位</label>
		<div class="col-sm-5">
			<input type="text" name="member" id="member"
				   placeholder="请输入成员单位" value="${teamInfoFilter.member}"
				   class="form-control ">
		</div>
	</div>


	<!--  		<label class="col-sm-1 control-label no-padding-right" for=registerDate>注册备案时间</label>
		<div class="col-sm-5">
			<input type="text" name="registerDate" id="registerDate" placeholder="请输入注册备案时间" value="${summaryFilter.registerDate}" class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right" for="countyEvaluation">县考评</label>
		<div class="col-sm-5">
			<input type="text" name="countyEvaluation" id="countyEvaluation" placeholder="县考评" value="${summaryFilter.countyEvaluation}" class="form-control ">
		</div>

		<label class="col-sm-1 control-label no-padding-right" for=reported>已上报招商办</label>
		<div class="col-sm-5">
			<input type="text" name="reported" id="reported" placeholder="请输入注册备案时间" value="${summaryFilter.reported}" class="form-control ">
		</div>
	</div>

	<div class="form-group">
	<%-- 	<label class="col-sm-1 control-label no-padding-right" for="taxproof">佐证材料</label>
		<div class="col-sm-5">
			<input type="text" name="taxproof" id="taxproof" placeholder="税收证明" value="${summaryFilter.taxproof}" class="form-control ">
		</div> --%>

		<label class="col-sm-1 control-label no-padding-right" for=investplan>项目投资进度计划表</label>
		<div class="col-sm-5">
			<input type="text" name="investplan" id="investplan" placeholder="项目投资进度计划表" value="${summaryFilter.investplan}" class="form-control ">
		</div>
	</div>-->

	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right" for="taxproof">佐证材料</label>
		<input class="col-sm-5" type="file" id="fileupload" name="files"
			accept=".zip"></input> <br>

		<button class="col-sm-5 btn btn-large btn-primary" id="btn">上传</button>

		<input type="text" name="taxproof" id="taxproof"
			value="${summaryFilter.taxproof}" class="form-control "
			style="display: none" />
		<input type="text" name="isaudit" id="isaudit"
			value="${summaryFilter.isaudit}" class="form-control " style="display: none"
			 />
		<input type="text" name="teamClass" id="teamClass"
			value="${teamInfoFilter.teamClass}" class="form-control "  style="display: none"
			 />
		<input type="text" name="datatime" id="datatime"
			   value="${summaryFilter.datatime}" class="form-control "  style="display: none"
		/>
	</div>


	<!-- <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"
			for="optionA">分类</label>
			
	</div>  -->



	<form:hidden path="sysId" />
</form:form>
<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/jquery-ui.js"></s:url>"></script>

<div id="dialog" title="提示">
	<div class="progress progress-striped active">
		<div class="progress-bar progress-bar-success" role="progressbar"
			aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
			style="width: 100%;"></div>

	</div>
	<p>正在上传 请稍后……</p>
</div>

<script type="text/javascript">
	$('#editor1').ace_wysiwyg({
		toolbar : [ 'font', null, 'fontSize', null, {
			name : 'bold',
			className : 'btn-info'
		}, {
			name : 'italic',
			className : 'btn-info'
		}, {
			name : 'strikethrough',
			className : 'btn-info'
		}, {
			name : 'underline',
			className : 'btn-info'
		}, null, {
			name : 'createLink',
			className : 'btn-pink'
		}, {
			name : 'unlink',
			className : 'btn-pink'
		}, null, {
			name : 'insertImage',
			className : 'btn-success'
		}, null, 'foreColor', null, {
			name : 'undo',
			className : 'btn-grey'
		}, {
			name : 'redo',
			className : 'btn-grey'
		} ]
	});
	//settingOneCheckTreeParam('#deptRelation','#deptRelation','resourceTree','#resourceTree','#resourceContent','<s:url value="/modules/sys/dept/json"></s:url>','#deptLevel','${sysDept.sysId}');

	/* settingOneCheckTreeParam({
		inputObjKey : '#deptRelation',
		treeObjName : 'resourceTree',
		treeContentKey : '#resourceContent',
	url : '<s:url value="/modules/sys/dept/json"></s:url>',
	levelKey : '#deptLevelForm',
	sysId : '${QuestionBank.sysId}'
	}); */

	$("#dialog").hide();
	$("#btn").click(function() {
		var fileval = $("#fileupload").val();
		if (fileval == null || fileval == "") {
			alert("未选择任何文件");
			return;
		}

		$("#dialog").show();
		$("#dialog").dialog();
		$.ajaxFileUpload({
			type : "post",
			fileElementId : "fileupload",
			secureuri : false,
			dataType : 'json',
			url : "/pictureUpload/uploadBatch",
			async : false,
			success : function(data) {
				var val = data.data.sysid;
				console.log(val);
				$("#taxproof").attr("value", val);
				$("#dialog").dialog("close");
				alert("成功");
			},
			error : function(data) {
				$("#dialog").dialog("close");
				alert("佐证材料上传失败 ！！请联系管理员");
			}

		});

	});
	var isauditval = $("#isaudit").val();
	console.log(isauditval);
	if(isauditval=='1'){
		$("#updatebtn").attr("disabled", true);
		console.log(isauditval+"111");
	}
	
	function findtwoClass() {
		var teamID = $("#teamClassId").val();
		var teamClassname = $("#teamClassId").find("option:selected").text();
		$("#teamClass").attr("value",teamClassname);
        //console.log(teamID);
		//alert(teamID);
		var teamcla = {
			"teamId" : teamID
		};

		$.ajax({
			url : "/chart/show/getTeamclassNames",
			dataType : "json", //返回数据形式为json
			type : "POST",
			contentType : 'application/json;charset=UTF-8',
			data : JSON.stringify(teamcla),
			success : function(data) {
				$("#teamname option").remove();
				$("#teamname").append(" <option value='00'>请选择</option>");
				for (var i = 0; i < data.data.length; i++) {
					var teamid = data.data[i].teamId;
					var teamname = data.data[i].teamName;
					$("#teamname").append(
							"<option value='"+teamname+"'>" + teamname
									+ "</option>");
					//console.log(teamname);
				}
			}
		});

	}
</script>
